package cn.new18.testactivitytask.activity;

import android.app.Activity;
import android.app.Fragment;
import android.content.Intent;
import android.os.Bundle;
import android.os.PersistableBundle;
import android.util.Log;
import android.widget.Button;
import android.widget.EditText;
import android.widget.TextView;

import butterknife.BindView;
import butterknife.ButterKnife;
import butterknife.OnClick;
import cn.new18.testactivitytask.R;
import cn.new18.testactivitytask.utils.StringUtils;

/**
 * Created by RaoWei on 2016/11/11 18:41.
 */

public class C extends Activity {
    private static final String TAG = "C";
    @BindView(R.id.c_et_s)
    EditText mCEtS;
    @BindView(R.id.c_et_n)
    EditText mCEtN;
    @BindView(R.id.c_btn)
    Button mCBtn;
    @BindView(R.id.tv)
    TextView mTv;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        Log.e(TAG, "onCreate");
        super.onCreate(savedInstanceState);
        setContentView(R.layout.c);
        ButterKnife.bind(this);
    }

    @OnClick(R.id.c_btn)
    public void onClick() {
        StringBuffer stringBuffer = new StringBuffer();
        String[] strings = StringUtils.StringToStringArray(mCEtS.getText().toString().trim(), Integer.parseInt(mCEtN.getText().toString().toString()));
        for (int i = 0; i < strings.length; i++) {
            String string = strings[i];
            stringBuffer.append("第"+i+"行："+string+"\n");
        }
        mTv.setText(stringBuffer);
    }

    @Override
    public void onCreate(Bundle savedInstanceState, PersistableBundle persistentState) {
        Log.e(TAG, "onCreate_2");
        super.onCreate(savedInstanceState, persistentState);
    }

    @Override
    protected void onPostCreate(Bundle savedInstanceState) {
        Log.e(TAG, "onPostCreate");
        super.onPostCreate(savedInstanceState);
    }

    @Override
    protected void onStart() {
        Log.e(TAG, "onStart");
        super.onStart();
    }

    @Override
    protected void onRestart() {
        Log.e(TAG, "onRestart");
        super.onRestart();
    }

    @Override
    public void onPostCreate(Bundle savedInstanceState, PersistableBundle persistentState) {
        Log.e(TAG, "onPostCreate_2");
        super.onPostCreate(savedInstanceState, persistentState);
    }

    @Override
    public void onRestoreInstanceState(Bundle savedInstanceState, PersistableBundle persistentState) {
        Log.e(TAG, "onRestoreInstanceState_2");
        super.onRestoreInstanceState(savedInstanceState, persistentState);
    }

    @Override
    protected void onRestoreInstanceState(Bundle savedInstanceState) {
        Log.e(TAG, "onRestoreInstanceState");
        super.onRestoreInstanceState(savedInstanceState);
    }

    @Override
    public void onStateNotSaved() {
        Log.e(TAG, "onStateNotSaved");
        super.onStateNotSaved();
    }

    @Override
    protected void onResume() {
        Log.e(TAG, "onResume");
        super.onResume();
    }

    @Override
    protected void onPostResume() {
        Log.e(TAG, "onPostResume");
        super.onPostResume();
    }

    @Override
    protected void onNewIntent(Intent intent) {
        Log.e(TAG, "onNewIntent");
        super.onNewIntent(intent);
    }

    @Override
    protected void onSaveInstanceState(Bundle outState) {
        Log.e(TAG, "onSaveInstanceState");
        super.onSaveInstanceState(outState);
    }

    @Override
    public void onSaveInstanceState(Bundle outState, PersistableBundle outPersistentState) {
        Log.e(TAG, "onSaveInstanceState_3");
        super.onSaveInstanceState(outState, outPersistentState);
    }

    @Override
    protected void onPause() {
        Log.e(TAG, "onPause");
        super.onPause();
    }

    @Override
    protected void onUserLeaveHint() {
        Log.e(TAG, "onUserLeaveHint");
        super.onUserLeaveHint();
    }

    @Override
    protected void onStop() {
        Log.e(TAG, "onStop");
        super.onStop();
    }

    @Override
    protected void onDestroy() {
        Log.e(TAG, "onDestroy");
        super.onDestroy();
    }

    @Override
    public void onLowMemory() {
        Log.e(TAG, "onLowMemory");
        super.onLowMemory();
    }

    @Override
    public void onTrimMemory(int level) {
        Log.e(TAG, "onTrimMemory");
        super.onTrimMemory(level);
    }

    @Override
    public void onAttachFragment(Fragment fragment) {
        Log.e(TAG, "onAttachFragment");
        super.onAttachFragment(fragment);
    }

    @Override
    public void onContentChanged() {
        Log.e(TAG, "onContentChanged");
        super.onContentChanged();
    }

    @Override
    public void onWindowFocusChanged(boolean hasFocus) {
        Log.e(TAG, "onWindowFocusChanged");
        super.onWindowFocusChanged(hasFocus);
    }

    @Override
    public void onAttachedToWindow() {
        Log.e(TAG, "onAttachedToWindow");
        super.onAttachedToWindow();
    }

    @Override
    public void onDetachedFromWindow() {
        Log.e(TAG, "onDetachedFromWindow");
        super.onDetachedFromWindow();
    }
}
